package org.opens.netty.udp.entity;

import lombok.Data;

import java.net.InetSocketAddress;

@Data
public class LogEvent {

    public static final byte SEPARATOR = (byte) ':';

    /**
     * 返回发送LogEvent的源的InetSocketAddress
     */
    private final InetSocketAddress source;

    /**
     * 返回锁发送的LogEvent的日志文件名称
     */
    private final String logfile;

    /**
     * 消息内容
     */
    private final String msg;

    /**
     * 返回接口LogEvent的时间
     */
    private final long received;

    public LogEvent(String logfile, String msg) {
        this(null, -1, logfile, msg);
    }

    public LogEvent(InetSocketAddress source, long received, String logfile, String msg) {
        this.source = source;
        this.logfile = logfile;
        this.msg = msg;
        this.received = received;
    }

}
